/**
 * 
 */
package net.greyar.model;

import java.io.IOException;

import net.greyar.gear.Machine;
import net.greyar.single.Catalog;
import net.greyar.theory.Symbol;

/**
 * 
 */
public class Server {

	/**
	 * @param task
	 * @return
	 * @throws IOException 
	 */
	public Symbol execute(Symbol task) throws IOException {
		if (task.get(0).getToken().equals("create")) {
			Machine machine = new Machine(this, task.get(1).getToken(), Catalog.getRules(task.get(1).getToken()));
			return Symbol.parse("machine " + machine.getName());
		}
		return null;
	}
}
